<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Monitoring classes and subscriber functions</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongodb-bson-undefined.unserialize.html">« MongoDB\BSON\Undefined::unserialize</a></li>
      <li style="float: right;"><a href="ref.monitoring.functions.html">函数 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="set.mongodb.html">MongoDB</a></li>
    <li>Monitoring classes and subscriber functions</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongodb.monitoring" class="book">
  <h1 class="title">Monitoring classes and subscriber functions</h1>
  

  

  
 





  
 





  
 






  
 





  
 





  
 





  
 





  
 





  
 





  
 





  
 





  
 






  






  






  
 





 <ul class="chunklist chunklist_book"><li><a href="ref.monitoring.functions.html">函数</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.mongodb.driver.monitoring.addsubscriber.html">MongoDB\Driver\Monitoring\addSubscriber</a> — Registers a monitoring event subscriber globally</li><li><a href="function.mongodb.driver.monitoring.removesubscriber.html">MongoDB\Driver\Monitoring\removeSubscriber</a> — Unregisters a monitoring event subscriber globally</li></ul></li><li><a href="class.mongodb-driver-monitoring-commandfailedevent.html">MongoDB\Driver\Monitoring\CommandFailedEvent</a> — The MongoDB\Driver\Monitoring\CommandFailedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-commandfailedevent.getcommandname.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getCommandName</a> — Returns the command name</li><li><a href="mongodb-driver-monitoring-commandfailedevent.getdurationmicros.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getDurationMicros</a> — Returns the command's duration in microseconds</li><li><a href="mongodb-driver-monitoring-commandfailedevent.geterror.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getError</a> — Returns the Exception associated with the failed command</li><li><a href="mongodb-driver-monitoring-commandfailedevent.getoperationid.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getOperationId</a> — Returns the command's operation ID</li><li><a href="mongodb-driver-monitoring-commandfailedevent.getreply.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getReply</a> — Returns the command reply document</li><li><a href="mongodb-driver-monitoring-commandfailedevent.getrequestid.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getRequestId</a> — Returns the command's request ID</li><li><a href="mongodb-driver-monitoring-commandfailedevent.getserver.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getServer</a> — Returns the Server on which the command was executed</li><li><a href="mongodb-driver-monitoring-commandfailedevent.getserverconnectionid.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getServerConnectionId</a> — Returns the server connection ID for the command</li><li><a href="mongodb-driver-monitoring-commandfailedevent.getserviceid.html">MongoDB\Driver\Monitoring\CommandFailedEvent::getServiceId</a> — Returns the load balancer service ID for the command</li></ul></li><li><a href="class.mongodb-driver-monitoring-commandstartedevent.html">MongoDB\Driver\Monitoring\CommandStartedEvent</a> — The MongoDB\Driver\Monitoring\CommandStartedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-commandstartedevent.getcommand.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getCommand</a> — Returns the command document</li><li><a href="mongodb-driver-monitoring-commandstartedevent.getcommandname.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getCommandName</a> — Returns the command name</li><li><a href="mongodb-driver-monitoring-commandstartedevent.getdatabasename.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getDatabaseName</a> — Returns the database on which the command was executed</li><li><a href="mongodb-driver-monitoring-commandstartedevent.getoperationid.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId</a> — Returns the command's operation ID</li><li><a href="mongodb-driver-monitoring-commandstartedevent.getrequestid.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId</a> — Returns the command's request ID</li><li><a href="mongodb-driver-monitoring-commandstartedevent.getserver.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getServer</a> — Returns the Server on which the command was executed</li><li><a href="mongodb-driver-monitoring-commandstartedevent.getserverconnectionid.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getServerConnectionId</a> — Returns the server connection ID for the command</li><li><a href="mongodb-driver-monitoring-commandstartedevent.getserviceid.html">MongoDB\Driver\Monitoring\CommandStartedEvent::getServiceId</a> — Returns the load balancer service ID for the command</li></ul></li><li><a href="class.mongodb-driver-monitoring-commandsucceededevent.html">MongoDB\Driver\Monitoring\CommandSucceededEvent</a> — The MongoDB\Driver\Monitoring\CommandSucceededEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-commandsucceededevent.getcommandname.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getCommandName</a> — Returns the command name</li><li><a href="mongodb-driver-monitoring-commandsucceededevent.getdurationmicros.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getDurationMicros</a> — Returns the command's duration in microseconds</li><li><a href="mongodb-driver-monitoring-commandsucceededevent.getoperationid.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getOperationId</a> — Returns the command's operation ID</li><li><a href="mongodb-driver-monitoring-commandsucceededevent.getreply.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getReply</a> — Returns the command reply document</li><li><a href="mongodb-driver-monitoring-commandsucceededevent.getrequestid.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId</a> — Returns the command's request ID</li><li><a href="mongodb-driver-monitoring-commandsucceededevent.getserver.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getServer</a> — Returns the Server on which the command was executed</li><li><a href="mongodb-driver-monitoring-commandsucceededevent.getserverconnectionid.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getServerConnectionId</a> — Returns the server connection ID for the command</li><li><a href="mongodb-driver-monitoring-commandsucceededevent.getserviceid.html">MongoDB\Driver\Monitoring\CommandSucceededEvent::getServiceId</a> — Returns the load balancer service ID for the command</li></ul></li><li><a href="class.mongodb-driver-monitoring-serverchangedevent.html">MongoDB\Driver\Monitoring\ServerChangedEvent</a> — The MongoDB\Driver\Monitoring\ServerChangedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-serverchangedevent.gethost.html">MongoDB\Driver\Monitoring\ServerChangedEvent::getHost</a> — Returns the hostname of the server</li><li><a href="mongodb-driver-monitoring-serverchangedevent.getnewdescription.html">MongoDB\Driver\Monitoring\ServerChangedEvent::getNewDescription</a> — Returns the new description for the server</li><li><a href="mongodb-driver-monitoring-serverchangedevent.getport.html">MongoDB\Driver\Monitoring\ServerChangedEvent::getPort</a> — Returns the port on which this server is listening</li><li><a href="mongodb-driver-monitoring-serverchangedevent.getpreviousdescription.html">MongoDB\Driver\Monitoring\ServerChangedEvent::getPreviousDescription</a> — Returns the previous description for the server</li><li><a href="mongodb-driver-monitoring-serverchangedevent.gettopologyid.html">MongoDB\Driver\Monitoring\ServerChangedEvent::getTopologyId</a> — Returns the topology ID associated with this server</li></ul></li><li><a href="class.mongodb-driver-monitoring-serverclosedevent.html">MongoDB\Driver\Monitoring\ServerClosedEvent</a> — The MongoDB\Driver\Monitoring\ServerClosedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-serverclosedevent.gethost.html">MongoDB\Driver\Monitoring\ServerClosedEvent::getHost</a> — Returns the hostname of the server</li><li><a href="mongodb-driver-monitoring-serverclosedevent.getport.html">MongoDB\Driver\Monitoring\ServerClosedEvent::getPort</a> — Returns the port on which this server is listening</li><li><a href="mongodb-driver-monitoring-serverclosedevent.gettopologyid.html">MongoDB\Driver\Monitoring\ServerClosedEvent::getTopologyId</a> — Returns the topology ID associated with this server</li></ul></li><li><a href="class.mongodb-driver-monitoring-serveropeningevent.html">MongoDB\Driver\Monitoring\ServerOpeningEvent</a> — The MongoDB\Driver\Monitoring\ServerOpeningEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-serveropeningevent.gethost.html">MongoDB\Driver\Monitoring\ServerOpeningEvent::getHost</a> — Returns the hostname of the server</li><li><a href="mongodb-driver-monitoring-serveropeningevent.getport.html">MongoDB\Driver\Monitoring\ServerOpeningEvent::getPort</a> — Returns the port on which this server is listening</li><li><a href="mongodb-driver-monitoring-serveropeningevent.gettopologyid.html">MongoDB\Driver\Monitoring\ServerOpeningEvent::getTopologyId</a> — Returns the topology ID associated with this server</li></ul></li><li><a href="class.mongodb-driver-monitoring-serverheartbeatfailedevent.html">MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent</a> — The MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-serverheartbeatfailedevent.getdurationmicros.html">MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getDurationMicros</a> — Returns the heartbeat's duration in microseconds</li><li><a href="mongodb-driver-monitoring-serverheartbeatfailedevent.geterror.html">MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getError</a> — Returns the Exception associated with the failed heartbeat</li><li><a href="mongodb-driver-monitoring-serverheartbeatfailedevent.gethost.html">MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getHost</a> — Returns the hostname of the server</li><li><a href="mongodb-driver-monitoring-serverheartbeatfailedevent.getport.html">MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getPort</a> — Returns the port on which this server is listening</li><li><a href="mongodb-driver-monitoring-serverheartbeatfailedevent.isawaited.html">MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::isAwaited</a> — Returns whether the heartbeat used a streaming protocol</li></ul></li><li><a href="class.mongodb-driver-monitoring-serverheartbeatstartedevent.html">MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent</a> — The MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-serverheartbeatstartedevent.gethost.html">MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::getHost</a> — Returns the hostname of the server</li><li><a href="mongodb-driver-monitoring-serverheartbeatstartedevent.getport.html">MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::getPort</a> — Returns the port on which this server is listening</li><li><a href="mongodb-driver-monitoring-serverheartbeatstartedevent.isawaited.html">MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::isAwaited</a> — Returns whether the heartbeat used a streaming protocol</li></ul></li><li><a href="class.mongodb-driver-monitoring-serverheartbeatsucceededevent.html">MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent</a> — The MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-serverheartbeatsucceededevent.getdurationmicros.html">MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getDurationMicros</a> — Returns the heartbeat's duration in microseconds</li><li><a href="mongodb-driver-monitoring-serverheartbeatsucceededevent.gethost.html">MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getHost</a> — Returns the hostname of the server</li><li><a href="mongodb-driver-monitoring-serverheartbeatsucceededevent.getport.html">MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getPort</a> — Returns the port on which this server is listening</li><li><a href="mongodb-driver-monitoring-serverheartbeatsucceededevent.getreply.html">MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getReply</a> — Returns the heartbeat reply document</li><li><a href="mongodb-driver-monitoring-serverheartbeatsucceededevent.isawaited.html">MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::isAwaited</a> — Returns whether the heartbeat used a streaming protocol</li></ul></li><li><a href="class.mongodb-driver-monitoring-topologychangedevent.html">MongoDB\Driver\Monitoring\TopologyChangedEvent</a> — The MongoDB\Driver\Monitoring\TopologyChangedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-topologychangedevent.getnewdescription.html">MongoDB\Driver\Monitoring\TopologyChangedEvent::getNewDescription</a> — Returns the new description for the topology</li><li><a href="mongodb-driver-monitoring-topologychangedevent.getpreviousdescription.html">MongoDB\Driver\Monitoring\TopologyChangedEvent::getPreviousDescription</a> — Returns the previous description for the topology</li><li><a href="mongodb-driver-monitoring-topologychangedevent.gettopologyid.html">MongoDB\Driver\Monitoring\TopologyChangedEvent::getTopologyId</a> — Returns the topology ID</li></ul></li><li><a href="class.mongodb-driver-monitoring-topologyclosedevent.html">MongoDB\Driver\Monitoring\TopologyClosedEvent</a> — The MongoDB\Driver\Monitoring\TopologyClosedEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-topologyclosedevent.gettopologyid.html">MongoDB\Driver\Monitoring\TopologyClosedEvent::getTopologyId</a> — Returns the topology ID</li></ul></li><li><a href="class.mongodb-driver-monitoring-topologyopeningevent.html">MongoDB\Driver\Monitoring\TopologyOpeningEvent</a> — The MongoDB\Driver\Monitoring\TopologyOpeningEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-topologyopeningevent.gettopologyid.html">MongoDB\Driver\Monitoring\TopologyOpeningEvent::getTopologyId</a> — Returns the topology ID</li></ul></li><li><a href="class.mongodb-driver-monitoring-commandsubscriber.html">MongoDB\Driver\Monitoring\CommandSubscriber</a> — The MongoDB\Driver\Monitoring\CommandSubscriber interface<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-commandsubscriber.commandfailed.html">MongoDB\Driver\Monitoring\CommandSubscriber::commandFailed</a> — Notification method for a failed command</li><li><a href="mongodb-driver-monitoring-commandsubscriber.commandstarted.html">MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted</a> — Notification method for a started command</li><li><a href="mongodb-driver-monitoring-commandsubscriber.commandsucceeded.html">MongoDB\Driver\Monitoring\CommandSubscriber::commandSucceeded</a> — Notification method for a successful command</li></ul></li><li><a href="class.mongodb-driver-monitoring-sdamsubscriber.html">MongoDB\Driver\Monitoring\SDAMSubscriber</a> — The MongoDB\Driver\Monitoring\SDAMSubscriber interface<ul class="chunklist chunklist_book chunklist_children"><li><a href="mongodb-driver-monitoring-sdamsubscriber.serverchanged.html">MongoDB\Driver\Monitoring\SDAMSubscriber::serverChanged</a> — Notification method for a server description change</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.serverclosed.html">MongoDB\Driver\Monitoring\SDAMSubscriber::serverClosed</a> — Notification method for closing a server</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.serverheartbeatfailed.html">MongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatFailed</a> — Notification method for a failed server heartbeat</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.serverheartbeatstarted.html">MongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatStarted</a> — Notification method for a started server heartbeat</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.serverheartbeatsucceeded.html">MongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatSucceeded</a> — Notification method for a successful server heartbeat</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.serveropening.html">MongoDB\Driver\Monitoring\SDAMSubscriber::serverOpening</a> — Notification method for opening a server</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.topologychanged.html">MongoDB\Driver\Monitoring\SDAMSubscriber::topologyChanged</a> — Notification method for a topology description change</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.topologyclosed.html">MongoDB\Driver\Monitoring\SDAMSubscriber::topologyClosed</a> — Notification method for closing the topology</li><li><a href="mongodb-driver-monitoring-sdamsubscriber.topologyopening.html">MongoDB\Driver\Monitoring\SDAMSubscriber::topologyOpening</a> — Notification method for opening the topology</li></ul></li><li><a href="class.mongodb-driver-monitoring-subscriber.html">MongoDB\Driver\Monitoring\Subscriber</a> — The MongoDB\Driver\Monitoring\Subscriber interface</li></ul></div></div></div></body></html>